<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <div id="app">
    <h3>@keyup.enter → 监听键盘回车事件</h3>
    trim <input type="text" v-model.trim="trim">
    number <input type="text" v-model.number="number">
    <!-- <input v-model="username" type="text"> -->
    <!-- .lazy 输入框数据发生改变并且失去焦点的时候触发 -->
    lazy <input type="text" v-model.lazy="msg">

    change <input type="text" @change="change">
  </div>
  <script src="https://cdn.bootcdn.net/ajax/libs/vue/2.7.14/vue.js"></script>
  <script>
    const app = new Vue({
      el: '#app',
      data: {
        trim: '',
        number: '',
        username: '',
        msg: ''
      },
      methods: {
        change() {
          console.log('change');
        }
      }
    })
  </script>
</body>

</html>